import { Body, Controller, Get, HttpCode, Post, Query, Res, Sse, UseGuards } from '@nestjs/common';
import { AuthGuard } from 'src/modules/auth/auth.guard';
import { LlmService } from '../llm/llm.service';
import { Public } from '../auth/public.decorator';
import { ChatDto } from './dto/chat.dto';
import { Response } from "express";

@Controller('bot')
export class BotController {
    constructor(private readonly llmService: LlmService) { }

    @Post("/chat")
    @Public()
    async chat(@Body() chat: ChatDto) {
        return this.llmService.chatCompletion(chat)
    }

    @Post("/chatSse")
    @Public()
    @Sse()
    async chatSse(@Body() chat: ChatDto) {
        return this.llmService.chatCompletionSse(chat);
    }
}
